<?php
defined('IN_IXDCW') or exit('Access Denied');
require DT_CORE.'/'.MODULE_NAME.'/common.inc.php';
$tableBusiness = Table::name(Table::NAME_BUSINESS);
$tableBusinessAuth = Table::name(Table::NAME_BUSINESS_AUTH);
require_once DT_INC.'/post.func.php';
include load('search.lang');
$list = isset($list) && in_array($list, array(0, 1, 2)) ? $list : 0;
if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) {
	$areaid = $cityid;
	$ARE = $AREA[$cityid];
}
//$param = array('catid', 'areaid');
$buildBase = array('catid', 'areaid', 'kin', 'order', 'kw', 'ctp', 'bid', 'mid', 'sid', 'page');
$seo_file = 'index';
include DT_INC.'/seo.inc.php';
if($page == 1) $head_canonical = $MOD['linkurl'];
$CATEGORY = PCache::read('category-33.php');
$AREA = PCache::read('area.php');
$currentAreaid = $cityid;
$areaid = $currentAreaid;
$areaCondition =  $currentAreaid ? "and areaid in (".$AREA[$currentAreaid]['arrchildid'].")" : '' ;
$indexData = array();
$sqlNewBusiness = "
	select * from " . Table::name(Table::NAME_BUSINESS) . "
	where
		mainstore=1 and
		(status=3 or status =2)
		".$areaCondition."
	order by itemid DESC limit 10";
$indexData['newBusiness'] = $db->getAll($sqlNewBusiness);
$indexData['carCategory'] = __($CATEGORY)->filter(function($item){
	return $item['parentid'] ==  Business::CATID_CAR ;
});
$indexData['lifeCategory'] = __($CATEGORY)->filter(function($item){
	return $item['parentid'] ==  Business::CATID_LIFE ;
});
$indexData['areaChina'] = __($AREA)->filter(function($item){
	return $item['parentid'] == 0 ;
});
$imgWidth = array(70,100,150,100,70,70);
$imgHeight = array(50,75,105,75,50,50);
$carCatids = __($indexData['carCategory'])->pluck('catid');
$lifeCatids = __($indexData['lifeCategory'])->pluck('catid');
include template('list', MODULE_NAME);